package com.seqb.manage.reptile.controller;

import com.seqb.annotation.Log;
import com.seqb.common.ResultVo;
import com.seqb.common.controller.BaseController;
import com.seqb.manage.reptile.service.PaperReptileService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.Map;

/**
 * @author lilinshen
 * @title 试题爬虫controller
 * @description 请填写相关描述
 * @date 2019/12/9
 */
@Controller
@RequestMapping("/manage/reptile/paperReptile")
public class PaperReptileController extends BaseController {

    @Autowired
    private PaperReptileService paperReptileService;

    @GetMapping("")
    @RequiresPermissions("manage:reptile:paperReptile:list")
    @Log("试题爬虫首页")
    String paperReptile() {
        return "manage/reptile/paperReptile.list";
    }

    @ResponseBody
    @RequestMapping("/reptile")
    @RequiresPermissions("manage:reptile:paperReptile:reptile")
    @Log("试题爬虫数据")
    public ResultVo reptile(@RequestParam Map<String, Object> params) {
        return paperReptileService.reptile(params);
    }

    @ResponseBody
    @RequestMapping("/save")
    @RequiresPermissions("manage:reptile:paperReptile:save")
    @Log("试题爬虫数据保存")
    public ResultVo save(@RequestParam Map<String, Object> params) {
        return paperReptileService.save(params);
    }
}
